package com.paiai.lslease.service.apphouse;

import com.paiai.lslease.auto.model.AppLock;
import com.paiai.lslease.auto.model.AppLockTenant;
import com.paiai.lslease.model.AppLockTenantInfo;

import java.sql.SQLException;
import java.util.List;

public interface AppLockTenantService {

    /**
     * 添加一个租客
     */
    AppLockTenant insertLockTenant(AppLockTenant appLockTenant) throws Exception;

    /**
     * 删除一个租客
     */
    boolean deleteLockTenant(int lockTenantId) throws Exception;

    /**
     * 删除一个租客某个设备的所有租住记录
     */
    boolean deleteLockTenant(int tenantId, int lockId) throws Exception;

    /**
     * 删除设备下的所有租客
     */
    boolean deleteAllLockTenantByLockId(int lockId) throws Exception;

    /**
     * 更新租客租房信息与设备自定义配置信息
     */
    AppLockTenant modifyLockTenant(AppLockTenant appLockTenant) throws Exception;

    /**
     * 查询设备下所有的租客信息
     */
    List<AppLockTenantInfo> selectAllLockTenant(int lockId) throws Exception;

    /**
     * 查询租客所有的设备信息
     */
    List<AppLock> selectAllTenantLock(int tenantId) throws Exception;

    /**
     * 查询单个租客信息
     */
    AppLockTenant selectLockTenant(int lockTenantId) throws Exception;

    /**
     * 用户是否已入住某个设备
     */
    boolean userHasLock(String mobile, int lockId) throws Exception;

    /**
     * 检查租客房间是否到期
     */
    boolean tenantExpired(int tenantId, int lockId) throws Exception;
}
